fix: add tooltip to truncated span names in HTML report#5164
Conversation
Span names with text-overflow:ellipsis now show the full name on hover via a title attribute.
There was a problem hiding this comment.
Code Review
This is a clean, minimal fix that improves UX without any downsides.
What the change does
Adds a title attribute to the .sp-name span so browsers display a native tooltip with the full span name on hover — matching the existing behavior already applied to the .sp-bar element on the same row.
Observations
Consistency — The .sp-bar div immediately after this span already had a title attribute (esc(s.name) + ' (' + fmt(s.durationMs) + ')'). This change brings the label span in line with that pattern, making the tooltip behavior consistent across both visual representations of the same span.
Correctness — esc(s.name) is used for both the content and the title attribute value, which is correct. HTML-escaping special characters in attribute values prevents attribute injection (e.g. if a span name contains ").
Minimal footprint — Single-character change (+1/-1). No logic changes, no risk of regression.
Suggestion (minor, optional)
The tooltip on .sp-bar shows duration alongside the name (esc(s.name) + ' (' + fmt(s.durationMs) + ')'). You could optionally do the same here for extra context, but the current approach is perfectly fine — the duration is already visible in the adjacent .sp-dur span.
Approved as-is. Good catch that the label was missing this while the bar already had it.
Updated [TUnit.Core](https://github.com/thomhurst/TUnit) from 1.19.0 to 1.19.74. <details> <summary>Release notes</summary> _Sourced from [TUnit.Core's releases](https://github.com/thomhurst/TUnit/releases)._ ## 1.19.74 <!-- Release notes generated using configuration in .github/release.yml at v1.19.74 --> ## What's Changed ### Other Changes * feat: per-hook activity spans with method names by @thomhurst in thomhurst/TUnit#5159 * fix: add tooltip to truncated span names in HTML report by @thomhurst in thomhurst/TUnit#5164 * Use enum names instead of numeric values in test display names by @Copilot in thomhurst/TUnit#5178 * fix: resolve CS8920 when mocking interfaces whose members return static-abstract interfaces by @lucaxchaves in thomhurst/TUnit#5154 ### Dependencies * chore(deps): update tunit to 1.19.57 by @thomhurst in thomhurst/TUnit#5157 * chore(deps): update dependency gitversion.msbuild to 6.6.1 by @thomhurst in thomhurst/TUnit#5160 * chore(deps): update dependency gitversion.tool to v6.6.1 by @thomhurst in thomhurst/TUnit#5161 * chore(deps): update dependency polyfill to 9.20.0 by @thomhurst in thomhurst/TUnit#5163 * chore(deps): update dependency polyfill to 9.20.0 by @thomhurst in thomhurst/TUnit#5162 * chore(deps): update dependency polyfill to 9.21.0 by @thomhurst in thomhurst/TUnit#5166 * chore(deps): update dependency polyfill to 9.21.0 by @thomhurst in thomhurst/TUnit#5167 * chore(deps): update dependency polyfill to 9.22.0 by @thomhurst in thomhurst/TUnit#5168 * chore(deps): update dependency polyfill to 9.22.0 by @thomhurst in thomhurst/TUnit#5169 * chore(deps): update dependency coverlet.collector to 8.0.1 by @thomhurst in thomhurst/TUnit#5177 ## New Contributors * @lucaxchaves made their first contribution in thomhurst/TUnit#5154 **Full Changelog**: thomhurst/TUnit@v1.19.57...v1.19.74 ## 1.19.57 <!-- Release notes generated using configuration in .github/release.yml at v1.19.57 --> ## What's Changed ### Other Changes * fix: use unique artifact names to avoid collisions in matrix builds by @thomhurst in thomhurst/TUnit#5132 * fix: resolve IndexOutOfRangeException with MethodDataSource<T> on class (#5118) by @thomhurst in thomhurst/TUnit#5137 * fix: prevent StringEqualsAssertion from matching non-string types by @thomhurst in thomhurst/TUnit#5156 ### Dependencies * chore(deps): update tunit to 1.19.22 by @thomhurst in thomhurst/TUnit#5117 * chore(deps): update dependency fsharp.core to 10.0.104 by @thomhurst in thomhurst/TUnit#5119 * chore(deps): update dependency microsoft.entityframeworkcore to 10.0.4 by @thomhurst in thomhurst/TUnit#5120 * chore(deps): update dependency fsharp.core to v11 by @thomhurst in thomhurst/TUnit#5128 * chore(deps): update dependency microsoft.templateengine.authoring.cli to v10.0.200 by @thomhurst in thomhurst/TUnit#5122 * chore(deps): update dependency dotnet-sdk to v10.0.200 by @thomhurst in thomhurst/TUnit#5123 * chore(deps): update dependency microsoft.sourcelink.github to 10.0.200 by @thomhurst in thomhurst/TUnit#5121 * chore(deps): update dependency system.commandline to 2.0.4 by @thomhurst in thomhurst/TUnit#5125 * chore(deps): update microsoft.extensions to 10.0.4 by @thomhurst in thomhurst/TUnit#5127 * chore(deps): update microsoft.build to 18.4.0 by @thomhurst in thomhurst/TUnit#5129 * chore(deps): update microsoft.aspnetcore to 10.0.4 by @thomhurst in thomhurst/TUnit#5126 * chore(deps): update dependency microsoft.templateengine.authoring.templateverifier to 10.0.200 by @thomhurst in thomhurst/TUnit#5124 * chore(deps): update microsoft.extensions to 10.4.0 by @thomhurst in thomhurst/TUnit#5130 * chore(deps): update dependency opentelemetry.instrumentation.aspnetcore to 1.15.1 by @thomhurst in thomhurst/TUnit#5136 * chore(deps): update dependency vogen to 8.0.5 by @thomhurst in thomhurst/TUnit#5133 * chore(deps): update dependency npgsql to 10.0.2 by @thomhurst in thomhurst/TUnit#5139 * chore(deps): update dependency microsoft.sourcelink.github to 10.0.201 by @thomhurst in thomhurst/TUnit#5141 * chore(deps): update dependency microsoft.entityframeworkcore to 10.0.5 by @thomhurst in thomhurst/TUnit#5140 * chore(deps): update dependency microsoft.templateengine.authoring.cli to v10.0.201 by @thomhurst in thomhurst/TUnit#5142 * chore(deps): update dependency microsoft.templateengine.authoring.templateverifier to 10.0.201 by @thomhurst in thomhurst/TUnit#5143 * chore(deps): update dependency npgsql.entityframeworkcore.postgresql to 10.0.1 by @thomhurst in thomhurst/TUnit#5145 * chore(deps): update dependency dotnet-sdk to v10.0.201 by @thomhurst in thomhurst/TUnit#5144 * chore(deps): update dependency system.commandline to 2.0.5 by @thomhurst in thomhurst/TUnit#5146 * chore(deps): update microsoft.aspnetcore to 10.0.5 by @thomhurst in thomhurst/TUnit#5147 * chore(deps): update dependency testcontainers.kafka to 4.11.0 by @thomhurst in thomhurst/TUnit#5149 * chore(deps): update microsoft.extensions to 10.0.5 by @thomhurst in thomhurst/TUnit#5148 * chore(deps): update dependency testcontainers.postgresql to 4.11.0 by @thomhurst in thomhurst/TUnit#5150 * chore(deps): update dependency testcontainers.redis to 4.11.0 by @thomhurst in thomhurst/TUnit#5151 * chore(deps): update dependency stackexchange.redis to 2.12.1 by @thomhurst in thomhurst/TUnit#5153 **Full Changelog**: thomhurst/TUnit@v1.19.22...v1.19.57 ## 1.19.22 <!-- Release notes generated using configuration in .github/release.yml at v1.19.22 --> ## What's Changed ### Other Changes * Remove redundant prefixes from tracing timeline spans by @thomhurst in thomhurst/TUnit#5111 * Render span tags and events on separate lines by @thomhurst in thomhurst/TUnit#5113 * Demote granular internal logs from Debug to Trace level by @thomhurst in thomhurst/TUnit#5116 ### Dependencies * chore(deps): update tunit to 1.19.16 by @thomhurst in thomhurst/TUnit#5109 **Full Changelog**: thomhurst/TUnit@v1.19.16...v1.19.22 ## 1.19.16 <!-- Release notes generated using configuration in .github/release.yml at v1.19.16 --> ## What's Changed ### Other Changes * Truncate exceptions in GitHub summary tables by @thomhurst in thomhurst/TUnit#5108 ### Dependencies * chore(deps): update tunit to 1.19.11 by @thomhurst in thomhurst/TUnit#5106 * chore(deps): bump dompurify from 3.3.0 to 3.3.2 in /docs by @dependabot[bot] in thomhurst/TUnit#5096 * chore(deps): bump svgo from 3.2.0 to 3.3.3 in /docs by @dependabot[bot] in thomhurst/TUnit#5086 **Full Changelog**: thomhurst/TUnit@v1.19.11...v1.19.16 ## 1.19.11 <!-- Release notes generated using configuration in .github/release.yml at v1.19.11 --> ## What's Changed ### Other Changes * Fix HTML report sort to also reorder groups by @thomhurst in thomhurst/TUnit#5103 * fix: correct expand-all icon SVG in HTML report by @slang25 in thomhurst/TUnit#5105 * Avoid some redundant list allocations by @SimonCropp in thomhurst/TUnit#4963 * avoid some redundant enumerable alloc by @SimonCropp in thomhurst/TUnit#4972 * use char instead of string for joins by @SimonCropp in thomhurst/TUnit#4989 ### Dependencies * chore(deps): update dependency nunit to 4.5.1 by @thomhurst in thomhurst/TUnit#5097 * chore(deps): update tunit to 1.19.0 by @thomhurst in thomhurst/TUnit#5099 * chore(deps): update dependency humanizer to 3.0.10 by @thomhurst in thomhurst/TUnit#5101 * chore(deps): update dependency nunit.analyzers to 4.12.0 by @thomhurst in thomhurst/TUnit#5102 **Full Changelog**: thomhurst/TUnit@v1.19.0...v1.19.11 Commits viewable in [compare view](thomhurst/TUnit@v1.19.0...v1.19.74). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updated [TUnit](https://github.com/thomhurst/TUnit) from 1.19.0 to 1.19.74. <details> <summary>Release notes</summary> _Sourced from [TUnit's releases](https://github.com/thomhurst/TUnit/releases)._ ## 1.19.74 <!-- Release notes generated using configuration in .github/release.yml at v1.19.74 --> ## What's Changed ### Other Changes * feat: per-hook activity spans with method names by @thomhurst in thomhurst/TUnit#5159 * fix: add tooltip to truncated span names in HTML report by @thomhurst in thomhurst/TUnit#5164 * Use enum names instead of numeric values in test display names by @Copilot in thomhurst/TUnit#5178 * fix: resolve CS8920 when mocking interfaces whose members return static-abstract interfaces by @lucaxchaves in thomhurst/TUnit#5154 ### Dependencies * chore(deps): update tunit to 1.19.57 by @thomhurst in thomhurst/TUnit#5157 * chore(deps): update dependency gitversion.msbuild to 6.6.1 by @thomhurst in thomhurst/TUnit#5160 * chore(deps): update dependency gitversion.tool to v6.6.1 by @thomhurst in thomhurst/TUnit#5161 * chore(deps): update dependency polyfill to 9.20.0 by @thomhurst in thomhurst/TUnit#5163 * chore(deps): update dependency polyfill to 9.20.0 by @thomhurst in thomhurst/TUnit#5162 * chore(deps): update dependency polyfill to 9.21.0 by @thomhurst in thomhurst/TUnit#5166 * chore(deps): update dependency polyfill to 9.21.0 by @thomhurst in thomhurst/TUnit#5167 * chore(deps): update dependency polyfill to 9.22.0 by @thomhurst in thomhurst/TUnit#5168 * chore(deps): update dependency polyfill to 9.22.0 by @thomhurst in thomhurst/TUnit#5169 * chore(deps): update dependency coverlet.collector to 8.0.1 by @thomhurst in thomhurst/TUnit#5177 ## New Contributors * @lucaxchaves made their first contribution in thomhurst/TUnit#5154 **Full Changelog**: thomhurst/TUnit@v1.19.57...v1.19.74 ## 1.19.57 <!-- Release notes generated using configuration in .github/release.yml at v1.19.57 --> ## What's Changed ### Other Changes * fix: use unique artifact names to avoid collisions in matrix builds by @thomhurst in thomhurst/TUnit#5132 * fix: resolve IndexOutOfRangeException with MethodDataSource<T> on class (#5118) by @thomhurst in thomhurst/TUnit#5137 * fix: prevent StringEqualsAssertion from matching non-string types by @thomhurst in thomhurst/TUnit#5156 ### Dependencies * chore(deps): update tunit to 1.19.22 by @thomhurst in thomhurst/TUnit#5117 * chore(deps): update dependency fsharp.core to 10.0.104 by @thomhurst in thomhurst/TUnit#5119 * chore(deps): update dependency microsoft.entityframeworkcore to 10.0.4 by @thomhurst in thomhurst/TUnit#5120 * chore(deps): update dependency fsharp.core to v11 by @thomhurst in thomhurst/TUnit#5128 * chore(deps): update dependency microsoft.templateengine.authoring.cli to v10.0.200 by @thomhurst in thomhurst/TUnit#5122 * chore(deps): update dependency dotnet-sdk to v10.0.200 by @thomhurst in thomhurst/TUnit#5123 * chore(deps): update dependency microsoft.sourcelink.github to 10.0.200 by @thomhurst in thomhurst/TUnit#5121 * chore(deps): update dependency system.commandline to 2.0.4 by @thomhurst in thomhurst/TUnit#5125 * chore(deps): update microsoft.extensions to 10.0.4 by @thomhurst in thomhurst/TUnit#5127 * chore(deps): update microsoft.build to 18.4.0 by @thomhurst in thomhurst/TUnit#5129 * chore(deps): update microsoft.aspnetcore to 10.0.4 by @thomhurst in thomhurst/TUnit#5126 * chore(deps): update dependency microsoft.templateengine.authoring.templateverifier to 10.0.200 by @thomhurst in thomhurst/TUnit#5124 * chore(deps): update microsoft.extensions to 10.4.0 by @thomhurst in thomhurst/TUnit#5130 * chore(deps): update dependency opentelemetry.instrumentation.aspnetcore to 1.15.1 by @thomhurst in thomhurst/TUnit#5136 * chore(deps): update dependency vogen to 8.0.5 by @thomhurst in thomhurst/TUnit#5133 * chore(deps): update dependency npgsql to 10.0.2 by @thomhurst in thomhurst/TUnit#5139 * chore(deps): update dependency microsoft.sourcelink.github to 10.0.201 by @thomhurst in thomhurst/TUnit#5141 * chore(deps): update dependency microsoft.entityframeworkcore to 10.0.5 by @thomhurst in thomhurst/TUnit#5140 * chore(deps): update dependency microsoft.templateengine.authoring.cli to v10.0.201 by @thomhurst in thomhurst/TUnit#5142 * chore(deps): update dependency microsoft.templateengine.authoring.templateverifier to 10.0.201 by @thomhurst in thomhurst/TUnit#5143 * chore(deps): update dependency npgsql.entityframeworkcore.postgresql to 10.0.1 by @thomhurst in thomhurst/TUnit#5145 * chore(deps): update dependency dotnet-sdk to v10.0.201 by @thomhurst in thomhurst/TUnit#5144 * chore(deps): update dependency system.commandline to 2.0.5 by @thomhurst in thomhurst/TUnit#5146 * chore(deps): update microsoft.aspnetcore to 10.0.5 by @thomhurst in thomhurst/TUnit#5147 * chore(deps): update dependency testcontainers.kafka to 4.11.0 by @thomhurst in thomhurst/TUnit#5149 * chore(deps): update microsoft.extensions to 10.0.5 by @thomhurst in thomhurst/TUnit#5148 * chore(deps): update dependency testcontainers.postgresql to 4.11.0 by @thomhurst in thomhurst/TUnit#5150 * chore(deps): update dependency testcontainers.redis to 4.11.0 by @thomhurst in thomhurst/TUnit#5151 * chore(deps): update dependency stackexchange.redis to 2.12.1 by @thomhurst in thomhurst/TUnit#5153 **Full Changelog**: thomhurst/TUnit@v1.19.22...v1.19.57 ## 1.19.22 <!-- Release notes generated using configuration in .github/release.yml at v1.19.22 --> ## What's Changed ### Other Changes * Remove redundant prefixes from tracing timeline spans by @thomhurst in thomhurst/TUnit#5111 * Render span tags and events on separate lines by @thomhurst in thomhurst/TUnit#5113 * Demote granular internal logs from Debug to Trace level by @thomhurst in thomhurst/TUnit#5116 ### Dependencies * chore(deps): update tunit to 1.19.16 by @thomhurst in thomhurst/TUnit#5109 **Full Changelog**: thomhurst/TUnit@v1.19.16...v1.19.22 ## 1.19.16 <!-- Release notes generated using configuration in .github/release.yml at v1.19.16 --> ## What's Changed ### Other Changes * Truncate exceptions in GitHub summary tables by @thomhurst in thomhurst/TUnit#5108 ### Dependencies * chore(deps): update tunit to 1.19.11 by @thomhurst in thomhurst/TUnit#5106 * chore(deps): bump dompurify from 3.3.0 to 3.3.2 in /docs by @dependabot[bot] in thomhurst/TUnit#5096 * chore(deps): bump svgo from 3.2.0 to 3.3.3 in /docs by @dependabot[bot] in thomhurst/TUnit#5086 **Full Changelog**: thomhurst/TUnit@v1.19.11...v1.19.16 ## 1.19.11 <!-- Release notes generated using configuration in .github/release.yml at v1.19.11 --> ## What's Changed ### Other Changes * Fix HTML report sort to also reorder groups by @thomhurst in thomhurst/TUnit#5103 * fix: correct expand-all icon SVG in HTML report by @slang25 in thomhurst/TUnit#5105 * Avoid some redundant list allocations by @SimonCropp in thomhurst/TUnit#4963 * avoid some redundant enumerable alloc by @SimonCropp in thomhurst/TUnit#4972 * use char instead of string for joins by @SimonCropp in thomhurst/TUnit#4989 ### Dependencies * chore(deps): update dependency nunit to 4.5.1 by @thomhurst in thomhurst/TUnit#5097 * chore(deps): update tunit to 1.19.0 by @thomhurst in thomhurst/TUnit#5099 * chore(deps): update dependency humanizer to 3.0.10 by @thomhurst in thomhurst/TUnit#5101 * chore(deps): update dependency nunit.analyzers to 4.12.0 by @thomhurst in thomhurst/TUnit#5102 **Full Changelog**: thomhurst/TUnit@v1.19.0...v1.19.11 Commits viewable in [compare view](thomhurst/TUnit@v1.19.0...v1.19.74). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
titleattribute to the.sp-namespan element in the trace timeline so that truncated span names show the full name on hovertext-overflow: ellipsisto long span names, but there was no way to see the full textTest plan
hook: TestHooks.LogTestResult...)